home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 24
/
Amiga Format AFCD24 (Feb 1998, Issue 108).iso
/
-seriously_amiga-
/
shareware
/
programming
/
amos
/
transi
/
t1.amos
/
t1.amosSourceCode
< prev
Wrap
AMOS Source Code
|
1998-01-05
|
7KB
|
278 lines
'Start check
Data 7818,7638,9186
Hide On : Curs Off : Flash Off : Print
For BANK=5 To 7
Read SHOULD_BE : IS=Length(BANK)
If SHOULD_BE<>IS Then FAIL=True : Print "Bank";BANK;" is";IS
Next
If FAIL
Print : Print "Someone changed the graphics!"
Print "This could get ugly."
Print : Print "Want to continue anyway?"
Do
A$="" : While A$=""
A$=Upper$(Inkey$)
Wend
If A$="Y" : Goto MAIN : End If
If A$="N" : Goto QUIT : End If
Loop
End If
'
'Finished checking graphics
'
MAIN:
Dim FARGER(31,2,1) : Rem Used by effect E
Global FARGER(),LAYER
'
Auto View Off
Screen Open 2,16,16,32,0 : Screen Hide 2 : Flash Off
THIS_ONE=6 : THAT_ONE=7 : SEEN=0 : UNSEEN=1
Unpack 5 To SEEN : Unpack THIS_ONE To UNSEEN : Screen To Front SEEN
Auto View On
'
'Prepare data for P effect ''''''''''''''''''''''''''''''''''''''''''''''''''
XER=Screen Width/16 : YER=Screen Height/16 : XYER=(XER*YER)-1
Dim X(XYER),Y(XYER)
X=0 : Y=0 : For A=0 To XYER
X(A)=X : Y(A)=Y
Add X,1,0 To XER-1 : If X=0 : Inc Y : End If
Next
For SHUFFLE=1 To 5
For A=0 To XYER
Repeat
B=Rnd(XYER)
Until B<>A
Swap X(A),X(B) : Swap Y(A),Y(B)
Next
Next
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
'Select-an-effect loop starts
Do
Follow Off
A$="" : While A$=""
A$=Upper$(Inkey$)
If Key Shift=8 Then Gosub CTRL
Wend
If A$=Chr$(27)
QUIT: Screen UNSEEN : Paper 1 : Pen 0 : Cls
Print At(8,16);"That's all for now then!"
On FX Gosub A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
End
End If
FX=Asc(A$)-64 : On FX Gosub A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
If OK
'Clean up ready for next
Auto View Off
Swap THIS_ONE,THAT_ONE : Unpack THIS_ONE To UNSEEN
Screen To Back UNSEEN : Auto View On
OK=False : OFX=FX
End If
Loop
'
'
CTRL:
'This is a simpler way to switch back and forth between Amos and WB
While Key Shift<>0 : Wend
Amos To Back
While Key Shift<>8 : Wend
While Key Shift<>0 : Wend
Amos To Front : Return
'
A: Rem Simple cut
Screen To Front UNSEEN : Swap SEEN,UNSEEN : OK=True
Return
'
B: Rem Fade to black and cut
Screen SEEN : Fade 5
Repeat : Until Colour(1)=0 : Wait 10 : Goto A
'
C: Rem Fade to black and back up
Screen 2 : Get Palette UNSEEN
Screen UNSEEN
For A=0 To Screen Colour-1 : Colour A,0 : Next
Gosub B : Rem Fade to black and cut
Screen SEEN : Fade 5 To 2
Repeat : Until Colour(1)=4095
Return
'
D: Rem Fast fade to white and back
Screen 2
For A=0 To 31 : Colour(A),4095 : Next
Screen SEEN : Fade 1 To 2
Repeat : Until Colour(0)=4095
Screen 2 : Get Palette UNSEEN
Screen UNSEEN : Get Palette SEEN
Gosub A : Fade 1 To 2
Repeat : Until Colour(0)=0
Return
'
E: Rem Flash over (Uses array dimensioned and globalized under MAIN:)
FINDCOLOURS[SEEN] : FINDCOLOURS[UNSEEN]
For A=0 To Screen Colour-1 : Colour(A),$FFF : Next
Screen SEEN : FAD[True]
Gosub A : Rem Cut
Screen SEEN : FAD[False]
Return
'' Procedures used by the above:
Procedure FINDCOLOURS[LAYER]
Screen LAYER : ANTFAR=Screen Colour
If ANTFAR>32
Default : Locate ,12 : Curs Off
Centre "Screen"+Str$(LAYER)+" is too deep -"+Str$(ANTFAR)+" colours!"
End
End If
For A=0 To ANTFAR-1
RGB=Colour(A)
FARGER(A,0,LAYER)=RGB
'Time for some arithmetics
FARGER(A,2,LAYER)=$FFF
R=RGB and $F00 : G=RGB and $F0 : B=RGB and F
Add R,$F00 : Add G,$F0 : Add B,$F
R=R/2 : G=G/2 : B=B/2
R=R and $F00 : G=G and $F0 : B=B and F
FARGER(A,1,LAYER)=R+G+B
Next
End Proc
Procedure FAD[OPP]
If OPP Then _START=0 Else _START=2
_SLUTT=2-_START : _STEG=Sgn(_SLUTT-_START)
For A=_START To _SLUTT Step _STEG
For B=0 To Screen Colour-1 : Colour B,FARGER(B,A,Screen)
Next : Wait 3 : Wait Vbl
Next
End Proc
'
F: Rem Roll over Beethoven
Auto View Off
Screen Display UNSEEN,,,,0
Auto View On
Gosub A
For A=1 To Screen Height : Screen Display SEEN,,,,A : Wait Vbl : Next
Return
'
G: Rem The other way round
For A=Screen Height To 0 Step -1 : Screen Display SEEN,,,,A : Wait Vbl : Next
Gosub A
Return
'
H: Rem Or combine the two
S0=Y Hard(0)
SH=Screen Height/2
Auto View Off
Screen Display UNSEEN,,SH,,0
Auto View On
Gosub A
For A=1 To SH : Screen Display SEEN,,S0+SH-A,,A*2 : Wait Vbl : Next
Return
'
I: Rem ...with a third
S0=Y Hard(0)
SH=Screen Height/2
Auto View Off
Screen Display UNSEEN,,SH,,0 : Screen Offset UNSEEN,,SH
Auto View On
Gosub A
For A=1 To SH
Screen Display SEEN,,S0+SH-A,,A*2
Screen Offset SEEN,,SH-A
Wait Vbl
Next
Return
'
'
'End of screen image transitions
'Start of screen data transitions
'
'
SIMILAR: Rem Check if pictures are similar for data transitions
Screen SEEN : SW1=Screen Width : SH1=Screen Height : SC1=Screen Colour
Screen UNSEEN : SW2=Screen Width : SH2=Screen Height : SC2=Screen Colour
If SW1<>SW2 or SH1<>SH2 or SC1<>SC2
Default : Print "Mismatch!!"
Print
Print "SW1=";SW1,"SW2=";SW2
Print "SH1=";SH1,"SH2=";SH2
Print "SC1=";SC1,"SC2=";SC2
End
End If
Return
'
J: Rem Built-in Appear
Gosub SIMILAR
Appear UNSEEN To SEEN,133 : OK=True
Return
'
K: Rem Growing square
Gosub SIMILAR
W2=SW1/2 : W1=W2-1
H2=SH1/2 : H1=H2-1
For A=1 To W2
Screen Copy UNSEEN,W1,H1,W2,H2 To SEEN,W1,H1 : Wait Vbl
Dec W1 : Dec H1 : Inc W2 : Inc H2
Next : OK=True
Return
'
L: Rem Plain wipe
Gosub SIMILAR
For A=0 To SW1-1
Screen Copy UNSEEN,A,0,A+1,SH1 To SEEN,A,0 : Wait Vbl
Next : OK=True
Return
'
M: Rem Double wipe
Gosub SIMILAR
For A=0 To SW1/2 : B=SW1-A
Screen Copy UNSEEN,A,0,A+1,SH1 To SEEN,A,0
Screen Copy UNSEEN,B,0,B+1,SH1 To SEEN,B,0 : Wait Vbl
Next : OK=True
Return
'
N: Rem Fancy wipe
Gosub SIMILAR
For A=0 To SW1-4 Step 2 : B=SW1-A-3
Screen Copy UNSEEN,A,0,A+1,SH1 To SEEN,A,0
Screen Copy UNSEEN,B,0,B+1,SH1 To SEEN,B,0 : Wait Vbl
Next : OK=True
Return
'
O: Rem The same horizontally
Gosub SIMILAR
For A=0 To SH1-4 Step 2 : B=SH1-A-3
Screen Copy UNSEEN,0,A,SW1,A+1 To SEEN,0,A
Screen Copy UNSEEN,0,B,SW1,B+1 To SEEN,0,B : Wait Vbl
Next : OK=True
Return
'
P: Rem 16-squares (uses array prepared under MAIN:)
Gosub SIMILAR
For A=0 To XYER
X1=X(A)*16 : Y1=Y(A)*16 : X2=X1+16 : Y2=Y1+16
Screen Copy UNSEEN,X1,Y1,X2,Y2 To SEEN,X1,Y1 : Wait Vbl
Next : OK=True
Return
'
Q: Rem Here's a brand new one I just thought up
Gosub SIMILAR
SEC1=SH1/3 : SEC2=SEC1*2
For A=0 To SW1-1 : B=SW1-A
Screen Copy UNSEEN,A,0,A+1,SEC1 To SEEN,A,0
Screen Copy UNSEEN,B,SEC1,B+1,SEC2 To SEEN,B,SEC1
Screen Copy UNSEEN,A,SEC2,A+1,SH1-1 To SEEN,A,SEC2
Next : OK=True
Return
'
R:
S:
T:
U:
V:
W:
X:
Y:
Z: Rem The Return below is here just to catch the rest of the alphabet.
' [The labels above are just so the On Goto won't crash.]
'
FX=OFX : If FX=0 Then FX=Rnd(10)+5 : Rem To make sure it ends with an effect.
Return
'****************************************************************************